package com.future.baselib.inteface;


import java.util.Map;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;

/**
 * Created by jniu on 2017/5/17.
 */

public interface HttpService {

    @POST("{url}")
    @FormUrlEncoded
    Call<String> getData(@FieldMap Map<String, Object> map, @Path(value = "url", encoded = true) String url);

    @POST("{url}")
    Call<String> getData(@Path(value = "url", encoded = true) String url);


    @Multipart
    @POST("{url}")
    Call<String> uploadFile(@Path(value = "url", encoded = true) String url, @PartMap Map<String, String> map, @Part MultipartBody.Part file);


    @Multipart
    @POST("{url}")
    Call<String> uploadMutileImage(@Path(value = "url", encoded = true) String url, @Part MultipartBody.Part[] file);


    @POST("{url}")
    @Headers("Content-Type: application/json; charset=utf-8")
    Call<String> post(@Path(value = "url", encoded = true) String url, @Body String json);
}
